<script setup lang="ts">
import { initWujie } from "./utils/wujie";
import { initWebConfig, initI18nLocal } from "./utils/toml";
import { initToken } from "./utils/token";
import { initRoutes } from "./utils/route";
import { useRouter, useRoute } from "vue-router";
import { useStore } from "vuex";
import { useI18n } from "vue-i18n"
//
const router = useRouter();
const route = useRoute();
const store = useStore();
const i18n = useI18n();
//
// @ts-ignore
window.$s = store;
// @ts-ignore
window.$r = router;
const init = async () => {
  // 初始化微前端逻辑
  await initWujie({ router, route, store });
  //
  initI18nLocal(i18n)
  // 初始化基础配置
  await initWebConfig();
  // 初始化 token
  await initToken({route,router,store});
  // // 这里默认使用配置文件的 routes ,如果需要用接口获取,需要自定义实现!
  await initRoutes({router,route,store});
};

init();
</script>

<template>
  <router-view />
</template>

<style>
* {
  margin: 0;
  padding: 0;
}
/* 解决用户代理样式表样式问题 */
:focus {
  outline: none;
}
.el-popper {
  max-width: 75%;
}
</style>
